using UnityEngine;
// [Assembly-CSharp.dll].LevelSelector
public class LevelSelector : MonoBehaviour
{
    // Fields
    public int currentPage;
    public int maxPage;
    public System.Collections.Generic.List<LevelItem> itemList;
    
    // Methods
    private void Start()
    {
        this.currentPage = 0;
        this.RefreshItem();
    }
    private void OnEnable()
    {
        this.currentPage = 0;
        this.RefreshItem();
    }
    private void Update()
    {
    
    }
    private void RefreshItem()
    {
        var val_9 = 0;
        do
        {
            if(val_9 >= W9)
        {
                return;
        }
        
            this.itemList.Item[0].gameObject.SetActive(value:  false);
            this.itemList.Item[0].gameObject.SetActive(value:  true);
            this.itemList.Item[0].RefreshItem(page:  this.currentPage, isDone:  ((val_9 + (this.currentPage << 3)) <= (UnityEngine.PlayerPrefs.GetInt(key:  -1610601669))) ? 1 : 0);
            val_9 = val_9 + 1;
        }
        while(this.itemList != null);
        
        throw new NullReferenceException();
    }
    public void NextPage()
    {
        mem[536882947] + 56.Play();
        int val_2 = this.currentPage;
        int val_1 = this.maxPage;
        val_1 = val_1 - 1;
        if(val_2 < val_1)
        {
                val_2 = val_2 + 1;
            this.currentPage = val_2;
        }
        
        this.RefreshItem();
    }
    public void PreviousPage()
    {
        mem[536882947] + 56.Play();
        int val_1 = this.currentPage;
        val_1 = val_1 - 1;
        if()
        {
                this.currentPage = val_1;
        }
        
        this.RefreshItem();
    }
    public void GoToLevel(int index)
    {
        int val_3 = index;
        UnityEngine.PlayerPrefs.SetInt(key:  -1610608821, value:  0);
        UnityEngine.PlayerPrefs.SetInt(key:  -1610605633, value:  0);
        val_3 = val_3 + (this.currentPage << 3);
        if(val_3 > (UnityEngine.PlayerPrefs.GetInt(key:  -1610601669)))
        {
                return;
        }
        
        mem[536882947] + 56.Play();
        UnityEngine.PlayerPrefs.SetInt(key:  -1610608379, value:  val_3);
        int val_2 = DG.Tweening.DOTween.KillAll(complete:  false);
        mem2[0] = 1;
        UnityEngine.SceneManagement.SceneManager.LoadScene(sceneBuildIndex:  3);
    }
    public LevelSelector()
    {
    
    }

}
